package cn.schoolwow.quickflow.service.executor.business;

import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.domain.FlowContext;
import cn.schoolwow.quickflow.flow.BusinessFlow;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;
import cn.schoolwow.quickflow.listener.SingleFlowListener;
import cn.schoolwow.quickflow.listener.TryCatchFinallyHandler;

public interface QuickFlowExecutorBusinessOperation {
    /**
     * 指定下一个业务逻辑
     */
    QuickFlowExecutor next(String flowName);

    /**
     * 指定下一个业务逻辑
     */
    QuickFlowExecutor next(BusinessFlow flow);

    /**
     * 指定下一个业务逻辑
     */
    QuickFlowExecutor next(CompositeBusinessFlow compositeBusinessFlow);

    /**
     * 流程执行前后事件监听
     */
    QuickFlowExecutor singleFlowListener(SingleFlowListener singleFlowListener);

    /**
     * 指定try-catch-finally处理器
     */
    QuickFlowExecutor tryCatchFinallyHandler(TryCatchFinallyHandler tryCatchFinallyHandler);

    /**
     * 执行业务逻辑
     */
    FlowContext execute();
}
